file_r = open("/Users/caozitong/Desktop/pytest1.txt", "r", encoding="utf-8")
file_a = open("/Users/caozitong/Desktop/pytest2.txt", "a", encoding="utf-8")

for i in file_r:
    i = i.strip()
    line = i.split(" ")[1]
    if line == "测试":
        continue
    file_a.write(i)
    file_a.write("\n")

file_r.close()
file_a.close()










